//
//  SingleSelectTableViewCell.m
//  Shengzhuli
//
//  Created by 卡忙科技 on 16/8/9.
//  Copyright © 2016年 kamangkeji. All rights reserved.
//

#import "SingleSelectTableViewCell.h"

@interface SingleSelectTableViewCell()<UITextFieldDelegate>

@property (weak, nonatomic) IBOutlet UIButton *pickSelfBtn;
@property (weak, nonatomic) IBOutlet UIButton *needsRiseBtn;
@property (weak, nonatomic) IBOutlet UITextField *riseField;

@end
@implementation SingleSelectTableViewCell

- (IBAction)btnClick:(UIButton *)btn
{
    btn.selected = !btn.selected;
    switch (btn.tag) {
        case 0:
        {
            if ([self.delegate respondsToSelector:@selector(singleSelectTableViewCellNeedsPickSelf:)]) {
                [self.delegate singleSelectTableViewCellNeedsPickSelf:btn.selected];
            }
        }
            break;
        case 1:
        {
            if ([self.delegate respondsToSelector:@selector(singleSelectTableViewCellNeedRise:)]) {
                [self.delegate singleSelectTableViewCellNeedRise:btn.selected];
            }
        }
            break;
        default:
            break;
    }
}
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
    if ([self.delegate respondsToSelector:@selector(singleSelectTableViewCellBeginEditing)]) {
        [self.delegate singleSelectTableViewCellBeginEditing];
    }
    return YES;
}


@end
